package org.apache.rocketmq.tools.admin;

import org.apache.rocketmq.client.MQAdmin;
import org.apache.rocketmq.client.exception.MQBrokerException;
import org.apache.rocketmq.client.exception.MQClientException;
import org.apache.rocketmq.common.Pair;
import org.apache.rocketmq.common.TopicConfig;
import org.apache.rocketmq.common.message.MessageQueue;
import org.apache.rocketmq.remoting.exception.*;
import org.apache.rocketmq.remoting.protocol.body.ClusterInfo;
import org.apache.rocketmq.remoting.protocol.body.KVTable;

import java.io.UnsupportedEncodingException;
import java.util.List;
import java.util.Map;
import java.util.Properties;
import java.util.Set;

public interface MQAdminExt extends MQAdmin {
    void start() throws MQClientException;

    void shutdown();

    void createAndUpdateTopicConfig(final String addr,
                                    final TopicConfig config) throws RemotingException, MQBrokerException,
            InterruptedException, MQClientException;


    void createOrUpdateOrderConf(String key, String value,
                                 boolean isCluster) throws RemotingException, MQBrokerException,
            InterruptedException, MQClientException;

    ClusterInfo examineBrokerClusterInfo() throws InterruptedException, MQBrokerException, RemotingTimeoutException,
            RemotingSendRequestException, RemotingConnectException;

    void deleteTopicInBroker(final Set<String> addrs, final String topic) throws RemotingException, MQBrokerException,
            InterruptedException, MQClientException;


    void deleteTopicInNameServer(final Set<String> addrs,
                                 final String clusterName,
                                 final String topic) throws RemotingException, MQBrokerException,
            InterruptedException, MQClientException;

}
